import newRequest from '@/utils/newRequest'
import request from '@/utils/request'
import { mergeParams } from '@/utils'

// 首页统计
export function getHomeTotal(query) {
  const data = mergeParams(query)
  return newRequest({
    url: '/MTSaas/home/total',
    method: 'post',
    data
  })
}

// 首页我上报的列表
export function getHomeMyApply(query) {
  const data = mergeParams(query)
  return newRequest({
    url: '/MTSaas/home/myApply',
    method: 'post',
    data
  })
}

// 首页待审批列表
export function getHomeNoAuditList(query) {
  const data = mergeParams(query)
  return newRequest({
    url: '/MTSaas/home/noAuditList',
    method: 'post',
    data
  })
}

// 首页消息列表
export function getHomeSysMessageList(query) {
  const data = mergeParams(query)
  return newRequest({
    url: '/MTSaas/home/sysMessageList',
    method: 'post',
    data
  })
}

export function initData(params) {
  return request({
    url: '/api/v1/dashboard',
    method: 'get',
    params
  })
}

export function projectData(params) {
  return request({
    url: '/api/v1/dashboard/project',
    method: 'get',
    params
  })
}

export function annualData(params) {
  return request({
    url: '/api/v1/dashboard/annual',
    method: 'get',
    params
  })
}

